function initPage() {
    document.getElementById("MODULE_DM_SJ").value = myTools.getQueryString("MODULE_DM");
    win.crebtn('editWindow_btnClose', '关闭',win.close);
    win.crebtn('editWindow_btnDel', '删除',delModuleAction);
    win.crebtn('editWindow_btnEdit', '修改', editModuleAction);
    win.crebtn('editWindow_btnAdd', '添加', addModuleAction);
    getModuleAction();
}
function getModuleAction() {
    var json = {
        url:contextPath +"/server/base/select.do",
        msg:"数据加载中.....",
        params:{
            "SQLID":"module.selectModule",
            "LX":"1",
            "MODULE_DM_SJ":myTools.getQueryString("MODULE_DM"),
            "PAGESIZE":"15"
        },
        callback:[getModuleActionCallBack]
    };
    AjaxTools.ajax(json);
}
function queryPage(page) {
    var json = {
        url:contextPath +"/server/base/select.do",
        msg:"数据加载中.....",
        form:"moduleForm",
        params:{
            "SQLID":"module.selectModule",
            "CURPAGE":page,
            "LX":"1",
            "MODULE_DM_SJ":myTools.getQueryString("MODULE_DM"),
            "PAGESIZE":"15"
        },
        callback:[getModuleActionCallBack]
    };
    AjaxTools.ajax(json);
}
function getModuleActionCallBack(json) {
    if (json.code == "00") {
        var a = {
            priKey:"MODULE_DM",
            header:["操作名称","操作地址","页面级别","显示顺序"],
            column:["MODULE_NAME","MODULE_URL","PAGE_JB","ORDERS"],
            aligns:["left","left","center","center"],
            width:[90,,60,60],
            data:json,
            pageFun:"queryPage"
        };
        myGrid.grid(a);
    } else {
        alert(json.data);
    }
}

/**
 *显示添加模块窗口
 */
function addModuleAction() {
    win.open('addWindow', '添加操作', '../../../admin/module/addModuleAction.jsp?MODULE_DM_SJ=' + document.getElementById("MODULE_DM_SJ").value, 450, 250, true, true, '', '', '', 'two');
}
/**
 *显示修改模块窗口
 */
function editModuleAction() {
    var id = myGrid.getSelectedID();
    if (id)
        win.open('editWindow', '修改操作', '../../../admin/module/editModuleAction.jsp?MODULE_DM=' + id, 450, 250, true, true, '', '', '', 'two');
}
/**
 * 删除模块
 */
function delModuleAction() {
    var ids = myGrid.getSelectedIDS();
    if (ids) {
        if (confirm("是否确认删除？")) {
            var json = {
                url:contextPath +"/server/base/delete.do",
                msg:"数据删除中.....",
                params:{
                    "SQLID":"module.deleteModule",
                    "IDS":ids
                },
                callback:[delModuleCallBack]
            };
            AjaxTools.ajax(json);
        }
    }
}
function delModuleCallBack(json) {
    var code = json.code;
    if (code == "00") {
        alert(json.data);
        getModuleAction();
    } else {
        alert(json.data);
    }

}